import HttpRequest from "../request";

/**
 * 获取所有用户信息
 *
 */
export async function getAllUser(params) {
  return HttpRequest({
    url: "/user/list",
    method: "POST",
    params: params,
  });
}

/**
 * 添加新用户
 *
 */
export async function addUser(params) {
  return HttpRequest({
    url: "/user/addUser",
    method: "POST",
    params: params,
  });
}

/**
 * 删除用户
 *
 */
export async function delUser(params) {
  return HttpRequest({
    url: "/user/remove",
    method: "DELETE",
    params: params,
  });
}

/**
 * 修改用户信息
 *
 */
export async function updateInfo(params) {
  return HttpRequest({
    url: "/user/update",
    method: "PUT",
    params: params,
  });
}

/**
 * 修改用户密码
 *
 */
export async function updatePsd(params) {
  return HttpRequest({
    url: "/user/updatePsd",
    method: "PUT",
    params: params,
  });
}

/**
 * 修改用户密码
 *
 */
export async function updatePsdByUserName(params) {
  return HttpRequest({
    url: "/user/updatePsdByUserName",
    method: "PUT",
    params: params,
  });
}
